var MongoClient = require("mongodb").MongoClient;
var url = "mongodb://119.23.182.180:10086/srp";

MongoClient.connect(url, function (err, db) {
  if (err) throw err;
  var dbo = db.db("srp");
  var whereStr = { userName: "masaikk" }; // 查询条件
  dbo
    .collection("code1")
    .find(whereStr)
    .toArray(function (err, result) {
      if (err) throw err;
      console.log(result);
      db.close();
    });
});
